﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>赛事明细</title>
    <link rel="stylesheet" href="css/amazeui.css">
    <script src="js/vue.js"></script>
    <script src="js/jquery-3.2.1.min.js"></script>
    <script src="js/common.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
    <style>
        * {
            padding: 0;
            border: 0;
            margin: 0;
        }

        .veads_01 {
            height: 6rem;
            width: 100%;
            overflow: hidden;
            padding: 0 3%;
            line-height: 6rem;
            z-index: 999999999;
            position: relative;
            background: #fff;
            border-bottom: 1px solid #d3d3d3;
        }

        .veads1_i1 {
            display: block;
            float: left;
            margin-top: 6%;
            width: 2.5%;
        }

        .veads1_s1 {
            display: block;
            text-align: center;
            font-size: 1.8rem;
        }

        .ordts_01 {
            width: 100%;
            overflow: hidden;
            padding: 0 3%;
        }

        .orde_02 {
            background: #efefef;
            width: 100%;
            padding: 1% 0;
        }

        .orde_03 {
            position: fixed;
            bottom: 0;
            width: 100%;
        }

        /*一下为临时*/
        .veas_10 {
            background: rgba(0,0,0,0.2);
            position: fixed;
            width: 100%;
            height: 100%;
            top: 0;
            z-index: 100000000;
        }

        .veas10_d1 {
            background: #fff;
            width: 100%;
            height: 75%;
            position: absolute;
            bottom: 0;
        }

        .veas10_d2 {
            width: 100%;
            padding: 3% 5%;
            overflow: hidden;
            border-bottom: 1px solid #d3d3d3;
        }

        .veas10_i1 {
            display: block;
            float: left;
            width: 3%;
            margin-top: 0.6%;
            margin-right: 10%;
        }

        .veas10_d3 {
            overflow: hidden;
            float: left;
            width: 25%;
            margin-right: 3%;
        }

        .veas10_s1 {
            height: 2.4rem;
            width: 50%;
            background: #efefef;
            border-radius: 3px;
            display: block;
            float: left;
            margin-right: 10%;
        }

        .veas10_s2 {
            display: block;
            float: left;
            width: 37%;
            margin-top: 4%;
            font-size: 1.2rem;
        }

        .veas10_d4 {
            overflow-y: auto;
            height: 50%;
            width: 100%;
        }

        .veas10_d5 {
            overflow: hidden;
            margin-top: 5%;
            padding-left: 15%;
        }

        .veas10_s3 {
            font-size: 1.2rem;
            display: block;
            margin-right: 2.6%;
            margin-bottom: 10%;
            margin-top: 11%;
            text-align: center;
        }

        .veas10_d6 {
            width: 100%;
            padding: 0 2%;
            overflow: hidden;
        }

        .veas10_s4 {
            font-size: 1.1rem;
            display: block;
            margin-right: 3.3%;
            width: 100%;
            /*margin-bottom: 0.8rem;*/
            height: 2.1rem;
            margin-bottom: 11.7%;
        }

        .veas10_s5 {
            display: block;
            height: 1.8rem;
            /*width: 9%;*/
            background: #efefef;
            border-radius: 5px;
            font-size: 1.1rem;
            text-align: center;
            color: #efefef;
            line-height: 1.8rem;
            float: left;
            margin-right: 1.8%;
            margin-bottom: 2%;
        }

        .veas10_d7 {
            padding: 3% 7%;
            width: 100%;
            margin-top: 1%;
        }

        .veas10_s6 {
            font-size: 2rem;
            display: block;
            margin-bottom: 3%;
        }

        .veas10_d8 {
            width: 10.5rem;
            border: 1px solid #23c788;
            overflow: hidden;
            padding-bottom: 0.3rem;
            float: left;
        }

        .veas10_s7 {
            display: block;
            font-size: 1.4rem;
            color: #727272;
            padding-left: 10%;
        }

        .veas10_s8 {
            display: block;
            color: #ff7676;
            font-size: 1.22rem;
            padding-left: 6%;
        }

        .veas10_i2 {
            display: block;
            float: right;
            margin-top: -20%;
            margin-right: 3%;
            width: 8%;
        }

        .veas10_d9 {
            overflow: hidden;
        }

        .veas10_d10 {
            overflow-x: auto;
        }

        .veas10_but {
            font-size: 1.8rem;
            text-align: center;
            color: #fff;
            background: #dadada;
            position: absolute;
            bottom: 0;
            border-radius: inherit;
            width: 100%;
            padding: 4% 0;
        }

        .veas10_s5_other {
            color: #fff;
            background: #23c788;
        }

        .other_veas10_d {
            height: 1.8rem;
            width: 90%;
            overflow: hidden;
            margin-right: 1.8%;
            margin-bottom: 9%;
            position: relative;
        }

        .other_veas10_s {
            height: 1.8rem;
            border-radius: 5px;
            font-size: 1.1rem;
            text-align: center;
            color: #efefef;
            line-height: 1.8rem;
            background: #23c788;
            position: absolute;
            display: none;
        }

        .veas10_but_other {
            background: #23c788;
        }

        .veas10_d11 {
            margin-bottom: 11.7%;
            border: 1px solid #efefef;
            background: #efefef;
            border-radius: 5px;
            height: 2.1rem;
        }

        .am-g_other {
            background: #23c788;
            color: #fff;
        }

        .vdts_s {
            border-radius: 5px;
            background: #efefef;
        }

        .vdts {
            width: 3.8rem;
        }

        .vedtls {
            background: #23c788;
            color: #fff;
            text-align: center;
            font-size: 0.8rem;
        }

        .veas10_other {
            width: 100%;
            height: 25%;
            position: absolute;
            top: 0;
        }
    </style>
</head>
<body>
    <div id="vult" v-cloak>

        <header data-am-widget="header" class="am-header am-header-default" style="background-color: #FFFFFF; border-bottom: 1px solid rgb(211, 211, 211);">
            <div class="am-header-left am-header-nav" onclick="goBack()">
                <a href="javascript:" class="">
                    <img class="am-header-icon-custom" src="images/veas07.png" alt="" />
                </a>
            </div>
            <h4 class="am-header-title" style=" color: black;">{{actinfo.Act.Name}}</h4>
            <div class="am-header-right am-header-nav"><a href="/Wap/Index.html" class="am-header-icon am-icon-home" style="color: #A9A9A9; "></a></div>
        </header>
        <ul class="am-list" style="    margin-bottom: 0.1rem;margin-top: 0">
            <li style="overflow: hidden;border-top: none;padding: 3% 0;color: #747474;font-size: 1.8rem;padding-left: 3%;"><span style="float:left;">{{actinfo.Act.Name}}</span></li>
        </ul>
        <div class="ordts_01">
            <ul class="am-list" style="margin-bottom: 0">
                <li style="overflow: hidden;border-top: none;padding: 3% 0;font-weight: 500"><span style="float:left;">联系电话</span><span style="float:right;">{{actinfo.Act.Phone}}</span></li>
                <li style="overflow: hidden;border-top: none;padding: 3% 0;font-weight: 500"><span style="float:left;">地址</span><span style="float:right;" v-on:click="toMap()">{{actinfo.Act.Adress}}</span><img src="images/veas03.png" alt="" style="margin-top: 1%;margin-right: 1%;width: 4.2%;float: right;"></li>
                <li style="overflow: hidden;border-top: none;padding: 3% 0;font-weight: 500"><span style="float:left;">赛事开始时间</span><span style="float:right;">{{actinfo.startTime}}</span></li>
                <li style="overflow: hidden;border-bottom: none;padding: 3% 0;font-weight: 500"><span style="float:left;">赛事结束时间</span><span style="float:right;">{{actinfo.endTime}}</span></li>
                <li style="overflow: hidden;border-bottom: none;padding: 3% 0;font-weight: 500"><span style="float:left;">报名开始时间</span><span style="float:right;">{{actinfo.startSignTime}}</span></li>
                <li style="overflow: hidden;border-bottom: none;padding: 3% 0;font-weight: 500"><span style="float:left;">报名结束时间</span><span style="float:right;">{{actinfo.endSignTime}}</span></li>
                <li style="overflow: hidden;border-bottom: none;padding: 3% 0;font-weight: 500"><span style="float:left;">详细</span><span style="float:right;" v-html="actinfo.Act.Info"></span></li>
            </ul>
        </div>
        <div class="orde_02"></div>
        <ul class="am-list" style="    margin-bottom: 0.1rem;margin-top: 0">
            <li style="overflow: hidden;border-top: none;padding: 3% 0;color: #747474;font-size: 1.8rem;padding-left: 3%;"><span style="float:left;">报名种类</span></li>
        </ul>
        <div class="ordts_01">
            <ul class="am-list" style="margin-bottom: 0" v-for="it in item">
                <li style="overflow: hidden;border-top: none;padding: 3% 0;font-weight: 500"><span style="float:left;font-size: 1.9rem">{{it.Name}}</span></li>
                <li style="overflow: hidden;padding: 3% 0;font-weight: 500"><span style="float:left;">最大报名数</span><span style="float:right;">{{it.maxSign==0?"无上限":it.maxSign}}</span></li>
                <li style="overflow: hidden;padding: 3% 0;font-weight: 500"><span style="float:left;">已报名人数</span><span style="float:right;">{{it.numSign}}</span></li>
                <li style="overflow: hidden;padding: 3% 0;font-weight: 500"><span style="float:left;">报名费</span><span style="float:right;">{{it.Price}}</span></li>
                <li style="overflow: hidden;padding: 3% 0;font-weight: 500">
                    <span style="float:left;"></span><span style="float:right;">
                        <button type="button" class="am-btn am-btn-default" v-on:click="Create(it.gId)" style="width: 100%; border: none;background: #23c788;color: #fff;">报名</button>
                    </span>
                </li>
            </ul>
        </div>


    </div>
</body>
</html>
<script>
    $(function () {
        var actid = $.getParam("gId");
        page.actid = actid;
        page.getInfo();
    })

    var page = new Vue({
        el: '#vult',
        data: {
            actid: 0,
            actinfo: { Act: {} },
            item: [],
        },
        methods: {
            getInfo: function () {
                var that = this;
                $.ajax({
                    type: 'GET',
                    url: apiUrl + '/Api/Field/GetActivityInfo',
                    data: { "gId": that.actid },
                    success: function (data) {
                        if (data.errcode == 0) {
                            that.actinfo = data.data.activityInfo;
                            that.item = data.data.activityInfo.item;
                        } else {
                            alert(data.errmsg);
                        }
                    },
                    //error: function () {
                    //    alert("服务器加载异常");
                    //}
                })
            },
            toMap: function () {
                location.href = 'map.html?xPoint=' + this.actinfo.Act.xPoint + "&yPoint=" + this.actinfo.Act.yPoint;
            },
            Create: function (actitid) {
                var that = this;
                $.ajax({
                    url: apiUrl + "/Api/Field/AddActivity",
                    data: { "gId": actitid },
                    type: "POST",
                    success: function (data) {
                        if (data.errcode == 0) {
                            //console.log(data);
                            location.replace("MyActivityInfo.html?gId=" + data.data.gId);
                        } else {
                            alert(data.errmsg);
                        }

                    },
                    //error: function () {
                    //    alert("响应失败");
                    //}
                })

                return false;
                $.ajax({
                    url: thisUrl + "/Api/Field/ReserveOrderPay",
                    data: { Id: that.orderid },
                    type: "POST",
                    success: function (data) {
                        if (data.errcode == 0) {
                            alert("支付成功");
                            location.replace(location.href);
                        } else {
                            alert(data.errmsg);
                        }
                    },
                    //error: function () {
                    //    alert("服务器响应异常");
                    //}
                })
            },
            cancel: function () {
                var that = this;
                if (confirm("确定取消订单吗？")) {
                    $.ajax({
                        url: thisUrl + "/Api/Field/ReserveOrderCancel",
                        data: { Id: that.orderid },
                        type: "POST",
                        success: function (data) {
                            if (data.errcode == 0) {
                                alert("取消成功");
                                location.replace(location.href);
                            } else {
                                alert(data.errmsg);
                            }
                        },
                        //error: function () {
                        //    alert("服务器响应异常");
                        //}
                    })
                }

            }
        }
    });
</script>
